package com.example.makerspace.dao;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.example.makerspace.domain.QuestionsCategoryDO;
import com.example.makerspace.mapper.QuestionsCategoryMapper;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;
import javax.annotation.Resource;
import java.util.List;
@Component
public class QuestionsCategoryDAO  extends BaseDAO<QuestionsCategoryDO>{
    @Resource
    private QuestionsCategoryMapper questionsCategoryMapper;

    @PostConstruct
    public void init(){
        this.mapper = questionsCategoryMapper;
    }

    public List<QuestionsCategoryDO> selectByType(Integer type) {
        QueryWrapper<QuestionsCategoryDO> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("type",type);
         return questionsCategoryMapper.selectList(queryWrapper);
    }
}
